home *** CD-ROM | disk | FTP | other *** search
/ Mac Power 1997 December / MACPOWER-1997-12.ISO.7z / MACPOWER-1997-12.ISO / AMUG / PROGRAMMING / Raven 1.2 Examples.sit / Raven 1.2 Examples / BoxPaint / Source / Texture.h < prev    next >
Text File  |  1997-03-09  |  2KB  |  65 lines

  1. /*
  2.  *  File:       Texture.h
  3.  *  Summary:    T3DPixmapTexture than can be drawn onto.
  4.  *  Written by: Jesse Jones
  5.  *
  6.  *  Copyright ゥ 1997 Jesse Jones. 
  7.  *    For conditions of distribution and use, see copyright notice in ZTypes.h  
  8.  *
  9.  *  Change History (most recent first):
  10.  *
  11.  *         <->      3/09/97    JDJ        Created.
  12.  */
  13.  
  14. #pragma once
  15.  
  16. #include <Z3DTextures.h>
  17. #include <ZPicture.h>
  18.  
  19.  
  20. // ===================================================================================
  21. //    class CTextureMap
  22. // ===================================================================================
  23. class CTextureMap : public T3DPixmapTexture {
  24.  
  25.     typedef T3DPixmapTexture Inherited;
  26.  
  27. //-----------------------------------
  28. //    Initialization/Destruction
  29. //
  30. public:
  31.     virtual                ~CTextureMap();
  32.                         
  33.                         CTextureMap(const TPicture& pict, ulong resolution);
  34.                         
  35. //-----------------------------------
  36. //    New API
  37. //
  38. public:
  39.             ulong         GetResolution() const                    {return this->GetWidth();}
  40.                         
  41.             void         SetResolution(ulong resolution);
  42.             
  43.             void         SetPict(const TPicture& pict);
  44.  
  45.             void         DrawLine(const TQ3Param2D& from, const TQ3Param2D& to);
  46.                         // Paints a line on the texture using UV coordinates.
  47.             
  48. //-----------------------------------
  49. //    Internal API
  50. //
  51. protected:
  52.             void         DrawLine(const TPoint& from, const TPoint& to);
  53.                         // Paints a line on the texture using pixmap coordinates.
  54.                         
  55.             void         SetPixel(SPixmapStorage& pixmap, const TPoint& pixel);
  56.             
  57. //-----------------------------------
  58. //    Member Data
  59. //
  60. protected:
  61.     TPicture    mPict;        // the original image
  62. };
  63.  
  64.  
  65.